<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title></title>

[#include "/admin/include/admin_static.htm"]
[#import "/admin/include/admin_pagination.ftl" as p/]
    <script>
        $(function() {
            $("#query").click(function() {
                $("#searchForm").attr("action","${path}/admin/repayment/list.aspx").submit();
            });

            $("#export").click(function() {
                $("#searchForm").attr("action","${path}/admin/repayment/exportRepaymentManage.aspx").submit();
            });
        });
    </script>
</head>
<body>
<div class="">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>还款明细</legend>
    </fieldset>
    <form id="searchForm" method="post" action="${path}/admin/repayment/list.aspx">
        <table class="search_table_div">
            <tr>
                <td class="column">用户ID：</td>
                <td><input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" name="userId" value="${userId }" /></td>
                <td class="column">用户名：</td>
                <td><input type="text" name="userName" value="${userName }" /></td>
                <td class="column">项目ID：</td>
                <td><input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" name="borrowId" value="${borrowId }" /></td>
                <td class="column">项目名：</td>
                <td><input type="text" name="borrowName" value="${borrowName }" /></td>

            </tr>
            <tr>
                <td class="column">还款状态：</td>
                <td>
                [@u.select list={"":"全部","0":"未还","1":"已还"}
                name="status" value="${(status)!''}" /]
                </td>
                <td class="column">应还日期：</td>
                <td colspan="3">
                    <input type="text" onclick="WdatePicker();" value="${begin_date }"
                           name="begin_date" class="short" readonly="readonly" />
                    <i>至</i>
                    <input type="text" onclick="WdatePicker();" value="${end_date }"
                           name="end_date" class="short" readonly="readonly" />
                </td>
            </tr>
            <tr>
                <th colspan="100" class="btn_td">
                    <input id="export" type="button"value="导出" class="layui-btn">
                    <input id="query" type="button"  value="查询" class="layui-btn"/>
                    <input onclick="resent();" type="button" value="清空"class="layui-btn"/>
                </th>
            </tr>
        </table>
    </form>
    <table class="layui-table">
        <colgroup>
            <col width="50">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">

            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
        </colgroup>
        <thead>
        <tr>
            <th>用户ID</th>
            <th>用户名称</th>
            <th>项目ID</th>
            <th>项目名称</th>
            <th>借款金额</th>
            <th>还款方式</th>
            <th>应还总额</th>
            <th>已还金额</th>
            <th>还款编号</th>
            <th>应还时间</th>
            <th>期数</th>
            <th>本次应还总额</th>
            <th>本次应还本金</th>
            <th>本次应还利息</th>
            <th>还款状态</th>
            <th>查看投标记录</th>
        </tr>
        </thead>
    [#list repayments as repayment]
        <tr>
            <td>${repayment.u_id}</td>
            <td><a class="uid" href="${path}/admin/user/userInfoDetail.aspx?id=${repayment.u_id}">
            ${repayment.u_username}
            </a>
            </td>
            <td>${repayment.id }</td>
            <td>${repayment.name }</td>
            <td>￥${repayment.account}</td>
            <td>
            ${p2p_get_dict("borrow_style",repayment.pay_style)}
            </td>
            <td>￥${repayment.repayment_account}</td>
            <td>￥${repayment.repayment_yesaccount}</td>
            <td>${repayment.r_id}</td>
            <td>
            ${p2p_date_format(repayment.r_stay_time,"yyyy-MM-dd HH:mm:ss")}
            </td>
            <td>${repayment.r_stay_periods }/${repayment.repayment_periods }</td>
            <td>￥${repayment.r_stay_account }</td>
            <td>￥${repayment.r_stay_capital }</td>
            <td>￥${repayment.r_stay_interest }</td>
            <td>
                [#if repayment.r_stay_status==0]未还[/#if]
                [#if repayment.r_stay_status==1]已还[/#if]
            </td>
            <td>
                <input type="button" value="投标记录" class="layui-btn"
                       onclick="window.location.href='${path}/admin/tender/tenderLog${repayment.id}.aspx'"
                       class="btn_blue" />
            </td>
        </tr>
    [/#list]
    </table>
[@p.pager pager = page parameterMap={"borrowId":"${borrowId}","status":"${status}","userId":"${userId }","userName":"${userName }","begin_date":"${begin_date }","end_date":"${end_date }"}   url = "${path}/admin/repayment/list.aspx"/]

</div>
</body>
</html>